package com.byedu.domain.focus.vo;

import com.byedu.domain.focus.FocusKpiDO;
import com.byedu.util.CommonUtil;

/**
 * Created by Luo on 2017-09-07.
 */
public class FocusKpiVO {
    /*id*/
    private String id;
    /*员工userId*/
    private FocusUserVO user;
    //年份
    private String pryear;
    //季度
    private String prjidu;
    /*指标数量*/
    private String kipnum= "0.0";
    /*已完成项*/
    private String doneponum = "0.0";
    /*开票金额*/
    private String billnum= "0.0";

    /*欠款金额*/
    private String lendnum= "0.0";

    //按产品分类， 按人员分类

    public String getPrjidu() {
        return prjidu;
    }

    public void setPrjidu(String prjidu) {
        this.prjidu = prjidu;
    }

    public String getPryear() {
        return pryear;
    }

    public void setPryear(String pryear) {
        this.pryear = pryear;
    }

    public String getDoneponum() {
        return doneponum;
    }

    public void setDoneponum(String doneponum) {
        this.doneponum = doneponum;
    }

    public String getKipnum() {
        return kipnum;
    }

    public void setKipnum(String kipnum) {
        this.kipnum = kipnum;
    }

    public String getBillnum() {
        return billnum;
    }

    public void setBillnum(String billnum) {
        this.billnum = billnum;
    }

    public FocusUserVO getUser() {
        return user;
    }

    public void setUser(FocusUserVO user) {
        this.user = user;
    }

    public FocusKpiVO(FocusKpiDO focusKpiDO, FocusUserVO focusUserVO) {
        if(focusUserVO != null) {
                 /*员工userId*/
            this.user = focusUserVO;
        }
        if(focusKpiDO!=null) {
            this.id = focusKpiDO.getId();
            //年份
            this.pryear = focusKpiDO.getPryear();
            //季度
            this.prjidu = focusKpiDO.getPrjidu();
    /*指标数量*/
            this.kipnum = focusKpiDO.getKipnum();
    /*已完成项*/
            this.doneponum = focusKpiDO.getDoneponum();
    /*开票金额*/
            this.billnum = focusKpiDO.getBillnum();
            this.lendnum = focusKpiDO.getLendnum();
        }
    }
    public FocusKpiVO() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "FocusKpiVO{" +
                "id='" + id + '\'' +
                ", user=" + user +
                ", pryear='" + pryear + '\'' +
                ", prjidu='" + prjidu + '\'' +
                ", kipnum='" + kipnum + '\'' +
                ", doneponum='" + doneponum + '\'' +
                ", billnum='" + billnum + '\'' +
                ", lendnum='" + lendnum + '\'' +
                '}';
    }

    public String getLendnum() {
        return lendnum;
    }

    public void setLendnum() {

        this.lendnum = CommonUtil.doubletoStr(CommonUtil.stringToDouble(billnum) - CommonUtil.stringToDouble(doneponum));

    }
}
